<%@ page import="java.util.List" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: haocongshun
  Date: 2016/10/14
  Time: 16:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../inc/top.jsp"%>
<script src="${CONTEXTPATH}/admin/static/user/allUser.js"></script>
<h3 style="font-weight: bold;">所有用户</h3>
<div class="mailbox-content" style="border: 1px #bbb solid;">
    <h4>全部用户(<span><%=((List<UserBean>)request.getAttribute("users")).size()%></span>)</h4>
    <hr/>
    <table class="table" id="presstable">
        <thead>
        <tr>
            <td>用户名</td>
            <td>昵称</td>
            <td>邮箱</td>
            <td>文章数量</td>
            <td>账号状态</td>
            <td>操作</td>
        </tr>
        </thead>
        <tbody>
                <c:forEach items="${requestScope.users}" var="user">
                <tr class="read checked">
                        <%--<td class="hidden-xs">--%>
                        <%--<input type="checkbox" class="checkbox">--%>
                        <%--</td>--%>
                            <td class="hidden-xs">
                                ${user.user_username}
                            </td>
                            <td class="hidden-xs">
                                ${user.user_nickname}
                            </td>
                            <td>
                                ${user.user_email}
                            </td>
                            <td class="content_count">
                                 ${user.user_content_count eq null ? 0:user.user_content_count}
                            </td>
                            <td class="status">
                                    ${user.user_status eq "normal" ? "正常":"冻结"}
                            </td>
                            <td>
                                <c:if test="${user.user_status eq 'normal'}">
                                    <button data-id="${user.user_id}" class="freezeBtn btn btn_5 btn-primary">冻结</button></a><span style="width: 25px;">&nbsp;</span>
                                </c:if>
                                <c:if test="${user.user_status eq 'freeze'}">
                                    <button data-id="${user.user_id}" class="unfreezeBtn btn btn_5 btn-danger">解冻</button></a><span style="width: 25px;">&nbsp;</span>
                                </c:if>

                                <%--<button data-id="${user.user_id}" class="deleteBtn btn btn_5 btn-danger">永久删除</button>--%>
                            </td>
                </tr>
                </c:forEach>
        </tbody>
    </table>
</div>
<%@include file="../inc/bottom.jsp"%>